feat(details): wire backend openIssuesCount into RepoStats#511
Conversation
…d signed-in users see live count
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
WalkthroughBackend repo DTO gains an ChangesOpen Issues Backend Integration
Sequence Diagram(s)sequenceDiagram
participant Client
participant DetailsRepo
participant Backend
participant Cache
participant GitHub
Client->>DetailsRepo: request getRepoStats(owner, repo)
DetailsRepo->>Cache: getStale(details:stats:v2:owner/repo)
DetailsRepo->>Backend: fetch backendRepo (includes openIssuesCount)
Backend-->>DetailsRepo: backendRepo(openIssuesCount,...)
alt GitHub enrichment available
DetailsRepo->>GitHub: fetch enrichment
GitHub-->>DetailsRepo: githubInfo
end
DetailsRepo->>Cache: write updated RepoStats (openIssues from backend, license with stale fallback if needed)
DetailsRepo-->>Client: RepoStats
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
…es don't shadow backend openIssues
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@core/presentation/src/commonMain/composeResources/files/whatsnew/16.json`:
- Around line 25-26: Update the second bullet string in the whatsnew entry that
currently reads "Open-issues count now shown to everyone, including signed-out
users — sourced from the backend, no GitHub quota cost." to remove the
definitive "no GitHub quota cost" claim and instead note that backend-sourced
stats may still fall back to GitHub in some cases; change the JSON string to a
toned-down sentence such as indicating the open-issues count is shown to all
users and is sourced from the backend but may still query GitHub on backend
errors or for license enrichment when signed-in.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: fb436c93-7a77-4f06-8578-6ce24c20a8b2
📒 Files selected for processing (15)
core/data/src/commonMain/kotlin/zed/rainxch/core/data/dto/BackendRepoResponse.ktcore/presentation/src/commonMain/composeResources/files/whatsnew/16.jsoncore/presentation/src/commonMain/composeResources/files/whatsnew/ar/16.jsoncore/presentation/src/commonMain/composeResources/files/whatsnew/bn/16.jsoncore/presentation/src/commonMain/composeResources/files/whatsnew/es/16.jsoncore/presentation/src/commonMain/composeResources/files/whatsnew/fr/16.jsoncore/presentation/src/commonMain/composeResources/files/whatsnew/hi/16.jsoncore/presentation/src/commonMain/composeResources/files/whatsnew/it/16.jsoncore/presentation/src/commonMain/composeResources/files/whatsnew/ja/16.jsoncore/presentation/src/commonMain/composeResources/files/whatsnew/ko/16.jsoncore/presentation/src/commonMain/composeResources/files/whatsnew/pl/16.jsoncore/presentation/src/commonMain/composeResources/files/whatsnew/ru/16.jsoncore/presentation/src/commonMain/composeResources/files/whatsnew/tr/16.jsoncore/presentation/src/commonMain/composeResources/files/whatsnew/zh-CN/16.jsonfeature/details/data/src/commonMain/kotlin/zed/rainxch/details/data/repository/DetailsRepositoryImpl.kt
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In
`@feature/details/data/src/commonMain/kotlin/zed/rainxch/details/data/repository/DetailsRepositoryImpl.kt`:
- Around line 520-523: The cache key was bumped to
"details:stats:v2:$owner/$repo" in getRepoStats (cacheKey variable) but
refreshRepository still invalidates the old "details:stats:$owner/$repo" key, so
update refreshRepository to delete/invalidate the new v2 key instead; locate
refreshRepository and replace or add invalidation for
"details:stats:v2:$owner/$repo" (matching the cacheKey string used in
getRepoStats) so refresh clears the same cache entry getRepoStats uses.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: c0471c7a-8cfb-4927-ad77-d6aa0e94b313
📒 Files selected for processing (1)
feature/details/data/src/commonMain/kotlin/zed/rainxch/details/data/repository/DetailsRepositoryImpl.kt
…ew/16.json Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
… manual refresh actually clears it
Summary
Backend just shipped
openIssuesCounton everyRepoResponsepayload (perdocs/client/open-issues-count.mdon the backend repo). Wires the field into the client so the open-issues stat on Details no longer depends on direct GitHub enrichment.Changes
BackendRepoResponse— addsopenIssuesCount: Int = 0(default = 0 for back-compat with old server during rollout, per backend doc §6).DetailsRepositoryImpl.getRepoStats— usesbackendRepo.openIssuesCountas the primary source. GitHub enrichment call still runs for license (backend hasn't shipped license yet), but the openIssues field no longer falls through it. Stale-cache fallback narrowed to the license field only — openIssues comes straight from the backend response.User-visible impact
0for anon since Fix rate-limit dialog firing on 200 responses + skip Details enrichment when anon #508 disabled the GitHub enrichment for unauthenticated users to preserve the 60/hr quota./refresh).16.json) across all 13 locales.Out of scope
StatItemis non-interactive and stats row UX is consistent across stars/forks/issues. Worth a separate UX pass — not bundling here.licenseper the existing follow-up in CLAUDE.md.Test plan
microsoft/vscode) — count matches GitHub website.api.github-store.org) — direct GitHub fallback path still populates openIssues from/repos/{owner}/{name}response.Summary by CodeRabbit
New Features
Improvements
Documentation